package com.xjl.everyinterview.datastructureandalgorithm.algorithm.sort.countsort;

/**
 * @author xjl
 * @version 1.0
 * @description: TODO
 * @date 2021/8/23 16:24
 */
public class CountSort {
    private int[] count;
    private int mix;

    public CountSort(int[] count, int mix) {
        this.count = count;
        this.mix = mix;
    }

    public int[] sort() {
        int[] reCount = new int[mix+1];
        for (int i = 0; i < count.length; i++) {
            System.out.println(count[i]);
            int i1 = reCount[count[i]];
            reCount[count[i]] = i1 + 1;


        }
        return reCount;
    }
}
